package com.qyl.deguru.service.impl;

import java.util.List;

import com.qyl.deguru.common.PageModel;
import com.qyl.deguru.common.QueryVo;
import com.qyl.deguru.dao.ShopDao;
import com.qyl.deguru.dao.impl.ShopDaoImple;
import com.qyl.deguru.dto.Shop;
import com.qyl.deguru.dto.ShopType;
import com.qyl.deguru.service.ShopService;
import com.qyl.deguru.service.ShopTypeService;

public class ShopServiceImple implements ShopService{
	ShopDao shopDao=new ShopDaoImple();
	ShopTypeService shopTypeService=new ShopTypeServcieImple();
	@Override
	public List<Shop> showShopList(Shop shop,PageModel pageModel) {
		return shopDao.showShopList(shop,pageModel);
	}
	@Override
	public int getcount() {
		return shopDao.getcount();
	}
	@Override
	public int delShopById(int id) {
		return shopDao.delShopById(id);
	}
	@Override
	public int delShops(int[] ids) {
		return shopDao.delShops(ids);
	}
	@Override
	public int addShop(Shop shop) {
		return shopDao.addShop(shop);
	}
	@Override
	public Shop getShopById(int id) {
		return shopDao.getShopById(id);
	}
	@Override
	public int shopUpdate(Shop shop) {
		String code=shop.getShopType().getCode();
		ShopType shopType=shopTypeService.getShopTypeByCode(code);
		shop.setShopType(shopType);
		System.out.println("22222shopType"+shopType);
		return shopDao.shopUpdate(shop);
	}

	@Override
	public List<Shop> getShop() {
		return shopDao.getShop();
	}
	@Override
	public List<Shop> getShopByisHot() {
		return shopDao.getShopByisHot();
	}
	@Override
	public List<Shop> getShopByisHot2() {
		return shopDao.getShopByisHot2();
	}
	@Override
	public List<Shop> getShopByisHot3() {
		return shopDao.getShopByisHot3();
	}
	@Override
	public List<Shop> getShopByisHot4() {
		return shopDao.getShopByisHot4();
	}
	@Override
	public List<Shop> getShopByisHot5() {
		return shopDao.getShopByisHot5();
	}
	@Override
	public List<Shop> getShopByCode(QueryVo queryVo) {
		return shopDao.getShopByCode(queryVo);
	}
	@Override
	public List<Shop> showAllShop() {

		return shopDao.showAllShop();
	}

}
